package cn.mifengkong.appcommon.webview.jshandler;


import com.mifengkong.frtools.jsbridge.CallBackFunction;
import com.mifengkong.frtools.jsbridge.JsHandler;

import cn.mifengkong.appcommon.webview.listener.JsBridgeCallBackListener;

/**
 * Created by jack on 2017/10/16
 */

public class CloseWebViewHandler implements JsHandler {

    private JsBridgeCallBackListener onCloseWebViewListener;

    public CloseWebViewHandler(JsBridgeCallBackListener onCloseWebViewListener) {
        this.onCloseWebViewListener = onCloseWebViewListener;
    }

    @Override
    public void OnHandler(String handlerName, String responseData, CallBackFunction function) {
        if (null != onCloseWebViewListener) {
            onCloseWebViewListener.closeWebView();
        }
    }
}
